package wpwork.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@TableName("ksh_message")
public class KshMessageEntity {

    @TableId(value = "f_id", type = IdType.ASSIGN_UUID)
    private String id;

    @TableField("f_type")
    private String type; // 消息类型：PERSONAL-个人消息, GROUP-群组消息

    @TableField("f_groupid")
    private String groupId;

    @TableField("f_fromuserid")
    private String fromUserId;

    @TableField("f_touserid")
    private String toUserId;

    @TableField("f_message")
    private String message;

    @TableField("f_isread")
    private Integer isRead;

    @TableField("f_readtime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime readTime;

    @TableField("f_remark")
    private String remark;

    @TableField("f_enabled_mark")
    private Integer enabledMark;

    @TableField("f_sort_code")
    private Long sortCode;

    @TableField(value = "f_creator_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime creatorTime;

    @TableField(value = "f_creator_user_id", fill = FieldFill.INSERT)
    private String creatorUserId;

    @TableField(value = "f_last_modify_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastModifyTime;

    @TableField(value = "f_last_modify_user_id", fill = FieldFill.INSERT_UPDATE)
    private String lastModifyUserId;

    @TableField("f_delete_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime deleteTime;

    @TableField("f_delete_user_id")
    private String deleteUserId;

    @TableField("f_delete_mark")
    @TableLogic
    private Integer deleteMark;

    @TableField("f_tenant_id")
    private String tenantId;
}